import 'dart:convert';

/// id : "14ce2f71-8ea4-4891-b8b3-e13ed7ee3746"
/// name : "EventBusUtils.txt"
/// duration : null
/// sourcePath : "http://192.168.3.231:8080/group1/default/20220425/14/29/1/61d74d19-bcab-42e7-b7ef-a6dd200006b8.txt?download=0"
/// thumbnailPath : "http://192.168.3.231:8080/group1/default/20220425/14/29/1/591dd61b-22f8-4d0b-bf7b-59a56b6deadb.pdf?download=0"
/// fileType : "txt"

FilePathEntity filePathEntityFromJson(String str) =>
    FilePathEntity.fromJson(json.decode(str));

String filePathEntityToJson(FilePathEntity data) => json.encode(data.toJson());

class FilePathEntity {
  FilePathEntity({
    String? id,
    String? name,
    String? duration,
    String? sourcePath,
    String? thumbnailPath,
    String? fileType,
  }) {
    _id = id;
    _name = name;
    _duration = duration;
    _sourcePath = sourcePath;
    _thumbnailPath = thumbnailPath;
    _fileType = fileType;
  }

  FilePathEntity.fromJson(dynamic json) {
    _id = json['id'] ?? "";
    _name = json['name'] ?? "";
    _duration = json['duration'].toString();
    _sourcePath = json['sourcePath'] ?? "";
    _thumbnailPath = json['thumbnailPath'] ?? "";
    _fileType = json['fileType'] ?? "";
  }

  String? _id;
  String? _name;
  String? _duration;
  String? _sourcePath;
  String? _thumbnailPath;
  String? _fileType;

  String? get id => _id;

  String? get name => _name;

  String? get duration => _duration;

  String? get sourcePath => _sourcePath;

  String? get thumbnailPath => _thumbnailPath;

  String? get fileType => _fileType;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['name'] = _name;
    map['duration'] = _duration;
    map['sourcePath'] = _sourcePath;
    map['thumbnailPath'] = _thumbnailPath;
    map['fileType'] = _fileType;
    return map;
  }
}
